package shili;

public interface NewsDao {
    public static NewsDao getInstance(String key){
        switch (key){
            case "mysql":
                return new NewsDaoServiceImpl();
            case "oracle":
                return new NewsDaoServiceImpl();
            case "redis":
                return new NewsDaoServiceImpl();
            default:
                throw new RuntimeException("无效的数据库类型"+key+",DAO获取失败");
        }
    }
}
